package com.zhang.payment8002.controller;


import com.zhang.payment8002.domain.Payment;
import com.zhang.payment8002.mapper.PaymentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Alger
 * @date 2021/8/16  21:04
 */
@RestController
@RequestMapping("payment")
public class PaymentController {

    @Autowired
    private PaymentMapper paymentMapper;

    @GetMapping("list")
    public List<Payment> list(){
        List<Payment> payments = paymentMapper.selectList(null);
        //仅仅为了测试负载均衡
        Payment payment = new Payment();
        payment.setId(8002L);
        payments.add(payment);
        return payments;
    }
}
